Update packaging: pyproject.toml, new deploy workflow#47
Open
C-Achard wants to merge 4 commits into
Open
Conversation
Replace the static dlclibrary/version.py with runtime version discovery using importlib.metadata in dlclibrary/__init__.py (sets __version__ and VERSION). Add a new pyproject.toml to define build system, metadata, dependencies and package data (moves requirements into project dependencies). Add an __init__.py for dlclibrary.dlcmodelzoo.superanimal_configs to make it a package and remove the old requirements.txt. These changes prepare the project for PEP 621 packaging and setuptools_scm-based versioning.
Replace the old release workflow with a modern build-and-publish job. Triggers now include tag pushes (v*.*.*) and manual workflow_dispatch; added permissions and concurrency controls. Job renamed to build-and-publish and updated to use actions/checkout@v6 (fetch-depth: 0) and actions/setup-python@v6 (python 3.12, pip cache). Install build tooling (build, twine, setuptools-scm), show SCM-derived version, build distributions with python -m build, validate with twine check, and upload non-interactively to PyPI only for tag refs. Removed legacy setup.py build steps and adjusted caching/install steps accordingly.
Contributor
There was a problem hiding this comment.
Pull request overview
Modernizes the project’s Python packaging by migrating from setup.py/requirements.txt to pyproject.toml with setuptools-scm-derived versions, and refreshes the PyPI release workflow to build/check/upload from tag pushes.
Changes:
- Replaced
setup.py+requirements.txtwith a PEP 621pyproject.tomlusingsetuptools-scmfor dynamic versioning. - Updated runtime version resolution to use installed package metadata (
importlib.metadata) instead of a staticversion.py. - Revamped the GitHub Actions release workflow to build via
python -m build, validate artifacts withtwine check, and publish only onv*.*.*tags.
Reviewed changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| setup.py | Removed legacy setuptools-based packaging configuration. |
| requirements.txt | Removed pinned dependency file in favor of pyproject.toml dependencies. |
| pyproject.toml | Added modern packaging metadata, SCM-based versioning, and package data inclusion rules. |
| dlclibrary/version.py | Removed static version constant module. |
| dlclibrary/init.py | Switched __version__ to metadata-derived version with fallback. |
| dlclibrary/dlcmodelzoo/superanimal_configs/init.py | Ensures config directory is treated as a package (empty initializer). |
| .github/workflows/release-pypi.yml | Updated release pipeline to build/check/publish with tag-driven versioning. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Introduce dlclibrary/version.py as a backwards-compatibility shim that exposes __version__ and VERSION. Attribute access is forwarded to dlclibrary.__version__ and dlclibrary.VERSION while emitting DeprecationWarning (stacklevel=2) advising callers to use the top-level attributes; other attribute lookups raise AttributeError.
deruyter92
approved these changes
May 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Modernized packaging and build workflow